import request from '@/utils/request2'

// 查询班级管理列表
export function listClass(query) {
  return request({
    url: '/stuManage/class/tree/list',
    method: 'get',
    params: query
  })
}

// 查询班级管理列表
export function listClassTree(stuClass) {
  return request({
    url: '/stuManage/class/list/tree',
    method: 'get',
    params:stuClass
  })
}

export function findChildrenStuClassCasById(parentId) {
  return request({
    url: '/stuManage/class/findChildrenCasById',
    method: 'get',
    params: parentId
  })
}

export function findChildrenStuClassCasByIds(parentIds) {
  return request({
    url: '/stuManage/class/findChildrenCasByIds/'+parentIds,
    method: 'get'
  })
}

export function findChildrenById(id) {
  return request({
    url: '/stuManage/class/findChildrenById',
    method: 'get',
    params: id
  })
}

export function findAreas() {
  return request({
    url: '/stuManage/class/findAreas',
    method: 'get'
  })
}

export function findAreaColleges() {
  return request({
    url: '/stuManage/class/findAreaColleges',
    method: 'get'
  })
}

export function findAreaCollegeGrades() {
  return request({
    url: '/stuManage/class/findAreaCollegeGrades',
    method: 'get'
  })
}

export function findAreaCollegeGradeProClass() {
  return request({
    url: '/stuManage/class/findAreaCollegeGradeProClass',
    method: 'get'
  })
}

export function getIdByValues(query) {
  return request({
    url: '/stuManage/class/getIdByValues',
    method: 'post',
    data: query
  })
}

// 查询班级管理详细
export function getClass(id) {
  return request({
    url: '/stuManage/class/' + id,
    method: 'get'
  })
}

// 新增班级管理
export function addClass(data) {
  return request({
    url: '/stuManage/class',
    method: 'post',
    data: data
  })
}

// 修改班级管理
export function updateClass(data) {
  return request({
    url: '/stuManage/class',
    method: 'put',
    data: data
  })
}

// 删除班级管理
export function delClass(id) {
  return request({
    url: '/stuManage/class/' + id,
    method: 'delete'
  })
}

// findChildrenNoCas
export function findStuClassChildrenNoCas(parentId) {
  return request({
    url: `/stuManage/class/findChildrenNoCas/${parentId}`,
    method: 'get'
  })
}
